package com.zahb.qadx.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by Zdw on 2020/11/03 11:49
 */
public class QuestionOption implements Parcelable {

    private int id;
    private int rootOrgId;
    private int questionId;
    private String content;
    private int isRightAnswer;
    private int optionIndex;
    private boolean delete;
    private boolean checked;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getRootOrgId() {
        return rootOrgId;
    }

    public void setRootOrgId(int rootOrgId) {
        this.rootOrgId = rootOrgId;
    }

    public int getQuestionId() {
        return questionId;
    }

    public void setQuestionId(int questionId) {
        this.questionId = questionId;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public int getIsRightAnswer() {
        return isRightAnswer;
    }

    public void setIsRightAnswer(int isRightAnswer) {
        this.isRightAnswer = isRightAnswer;
    }

    public int getOptionIndex() {
        return optionIndex;
    }

    public void setOptionIndex(int optionIndex) {
        this.optionIndex = optionIndex;
    }

    public boolean isDelete() {
        return delete;
    }

    public void setDelete(boolean delete) {
        this.delete = delete;
    }

    public boolean isChecked() {
        return checked;
    }

    public void setChecked(boolean checked) {
        this.checked = checked;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.id);
        dest.writeInt(this.rootOrgId);
        dest.writeInt(this.questionId);
        dest.writeString(this.content);
        dest.writeInt(this.isRightAnswer);
        dest.writeInt(this.optionIndex);
        dest.writeByte(this.delete ? (byte) 1 : (byte) 0);
        dest.writeByte(this.checked ? (byte) 1 : (byte) 0);
    }

    public QuestionOption() {
    }

    protected QuestionOption(Parcel in) {
        this.id = in.readInt();
        this.rootOrgId = in.readInt();
        this.questionId = in.readInt();
        this.content = in.readString();
        this.isRightAnswer = in.readInt();
        this.optionIndex = in.readInt();
        this.delete = in.readByte() != 0;
        this.checked = in.readByte() != 0;
    }

    public static final Creator<QuestionOption> CREATOR = new Creator<QuestionOption>() {
        @Override
        public QuestionOption createFromParcel(Parcel source) {
            return new QuestionOption(source);
        }

        @Override
        public QuestionOption[] newArray(int size) {
            return new QuestionOption[size];
        }
    };
}
